#set($title = "智能会议预定系统-登录")
<style media="all" type="text/css">
    html, body {
        font-family: '宋体';
        font-size: 14px;
        background: #F5F5F5;
    }
    
    html, body, ul, li {
        margin: 0;
        padding: 0;
    }
    
    .btn {
        display: block;
        cursor: pointer;
        background: #D74937;
        color: #fff;
        border: none;
        padding: 6px 20px;
        position: relative;
        top: -8px;
        border-radius: 3px;
    }
    
    .btn:hover {
        background: #D03D2A;
    }
    
    table td {
        padding: 6px 0;
    }
    
    table tr:hover td {
        background: #F5F5F5;
    }
    
    table tr:hover td.t {
        background: #Fff;
    }
    
    table tr.header td {
        padding: 4px;
        background: #F5F5F5;
        color: #DD3B3B;
        border: none;
    }
    
    table td.t {
        font-weight: bold;
        padding: 10px 0;
    }
    
    td.desc {
        color: #666;
    }
    
    .title {
        padding: 24px 0;
        font-size: 20px;
        color: #DD3B3B;
    }
    
    td.input {
        padding: 2px;
    }
    
    #win {
        margin: 100px auto 0;
        width: 400px;
    }
    
    .errormsg {
        color: red;
        line-height: 1.5em;
    }
</style>
<div id="win">
    <div class="title">
        登录
    </div>
    <div class="errormsg">
        <pre>$!error</pre>
    </div>
    <form action="/login" method="post">
        <table border="0" cellpadding="0" cellspacing="0">
            <tbody>
                <tr>
                    <td>
                        用户名
                    </td>
                    <td>
                        <input type="text" name="user" id="user">
                    </td>
                </tr>
                <tr>
                    <td>
                        密码
                    </td>
                    <td>
                        <input type="password" name="pwd" id="pwd">
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <div id="verifycodeimage" style="margin-bottom:3px; width:112 height:42">
                            <img src="/captcha-image" id= "kaptchaImage" width="112" height="42" class="absmiddle" alt="验证码" title="看不清？点击刷新验证码！" />
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        验证码
                    </td>
                    <td>
                        <input type="text" name="checkCode" id="checkcode">
                    </td>
                </tr>
                <tr>
                    <td>
                        <input type="submit" class="btn" value="登录">
                    </td>
                    <td>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>
</div>
<script type="text/javascript">
    $(function(){
        $("input[type='submit']").click(function(){
            if ($("#user").val().length == 0 || $("#pwd").val().length == 0 || $("#checkcode").val().length == 0) {
                alert("用户名,密码,验证码必填！");
                return false;
            }
        });
        $('#kaptchaImage').click(function(){ // 生成验证码
            $(this).hide().attr('src', '/captcha-image?' + Math.floor(Math.random() * 100)).fadeIn();
        }).attr("style", "cursor:pointer");
        var error = "$error";
        if (error == "-1") {
            $(".errormsg").hide();
        }
    });
</script>
